using HTCollections.Unsafe;
using Unity.Burst;
using Unity.Collections;
using Unity.Jobs;
using Unity.Mathematics;

namespace HTCollections.Job
{
    [BurstCompile]
    public struct KdTreeQueryRectJob : IJob
    {
        [ReadOnly] public UnsafeKdTree2D KdTree;
        [ReadOnly] public float4 Rect;
        [WriteOnly] public JobDataWrap<UnsafeList<float3>> Result;

        public unsafe void Execute()
        {
            KdTree.QueryNeighborList(Rect, Result.Ptr);
        }
    }
}